import { axios as request  } from '@/utils/request'
import qs from 'qs'

export function getList({params}) {
  return request({
    url: 'api/company?' + qs.stringify(params, {indices: false, encode: false}),
    method: 'get'
  })
}

export function get({id}) {
  return request({
    url: `api/company/single/${id}`,
    method: 'get'
  })
}

export function add({data}) {
  return request({
    url: 'api/company',
    method: 'post',
    data
  })
}

export function edit({data}) {
  return request({
    url: 'api/company',
    method: 'put',
    data
  })
}

export function del(id) {
  return request({
    url: `api/company/${id}`,
    method: 'delete'
  })
}

export function companyHasSelf(data) {
  return request({
    url: '/api/company/hasSelf',
    method: 'post',
    data
  })
}